﻿class DefaultDrawSwarm implements IDrawSwarm {

    environment: IEnvironment;

    Init(environment: IEnvironment) {
        this.environment = environment;
    }

    Draw(drawArea: IDrawArea) {
        var width = drawArea.GetCanvas().width;
        var height = drawArea.GetCanvas().height;
        drawArea.GetRenderingContext().clearRect(0, 0, width, height);

        drawArea.GetRenderingContext().fillStyle = "#000000";
        
        for (var i = 0; i < this.environment.NrOfBoids; i++) {
            var boid = this.environment.GetBoid(i);
            var x = boid.Position.X * width / 100;
            var y = boid.Position.Y * height / 100;
            drawArea.GetRenderingContext().fillRect(x, y, 5, 5);

        }

       // drawArea.GetRenderingContext().fillRect(this.environment., y * this.rectHeightInt, this.rectWidthInt, this.rectHeightInt);
    }

}